package com.example.testappwidget.ui.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment
import com.example.testappwidget.R

/**
 *Author: chinadragon
 *Time: 2024/7/8
 */
class SelectAnItemFragment : Fragment() {
    private lateinit var tv_content: TextView
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.item_select_detail, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        tv_content = view.findViewById(R.id.tv_content)
        tv_content.text = arguments?.getString(KEY_CONTENT) ?: "暂无数据"
    }

    companion object {
        const val KEY_CONTENT = "context"
        fun instance(bundle: Bundle): SelectAnItemFragment {
            return SelectAnItemFragment().apply { arguments = bundle }
        }
    }
}